package com.itlong.cloud.POJO.PO;

import com.itlong.cloud.annotation.ItlField;
import com.itlong.cloud.annotation.ItlTables;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * <desc>
 *      App用户信息实体类。
 * </desc>
 * @createDate 2017/09/18
 */
@ItlTables("app_user_info")
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class AppUserInfoPO extends BasePO implements Serializable {
    @ItlField(value = "user_id",logicKey = "key")
    private String userId;     //用户id
    @ItlField("real_name")
    private String realName;   //姓名
    @ItlField("nick_name")
    private String nickName;    //昵称
    @ItlField("password")
    private String password;    //密码
    @ItlField("phone_num")
    private String phoneNum;     //用户手机号
    @ItlField("email")
    private String email;     //邮箱
    @ItlField("icon")
    private String icon;       //头像地址
    @ItlField("address")
    private String address;     //地址
    @ItlField("gender")
    private Integer gender;         //性别：0女 1男
    @ItlField("birthday")
    private Date birthday;      //生日
    @ItlField("token")
    private String token;       //请求凭证
    @ItlField("mini_token")
    private String miniToken;       //小程序请求凭证
    @ItlField("ip_address")
    private String ipAddress;  //请求IP地址
    @ItlField("login_device")
    private Integer loginDevice;    //用户登录终端类型，1-android,2-iOS
    @ItlField("current_project_id")
    private String currentProjectId;        //当前项目id
    @ItlField("current_project_name")
    private String currentProjectName;        //当前项目名称
    @ItlField("is_online")
    private Integer isOnline; //当前用户是否在线,0-否，1-是
    @ItlField("uuid")
    private String uuid; //手机UUID
    @ItlField("cloud_intercom_account_id")
    private String cloudIntercomAccountId;  //与第三方账号信息表相关联
    @ItlField("phone_unique")
    private String phoneUnique;  //游客模式时上传的本机设备唯一码


//    @ItlField("source")
//    private Integer source;     //用户首次创建来源:1邀请 2注册 3管理员添加 4一卡通

    /** APP提交注册后保存用户
     *
     * @param userId  用户逻辑ID
     * @param realName  姓名
     * @param nickName 昵称
     * @param password 密码，MD5加密
     * @param phoneNum 手机号
     * @param gender 性别
     * @param token
     */
    public  AppUserInfoPO(
            String userId,String realName,String nickName,String password,String phoneNum,Integer gender,String token){
        this.userId = userId;
        this.realName = realName;
        this.nickName = nickName;
        this.password = password;
        this.phoneNum = phoneNum;
        this.gender = gender;
        this.token = token;
    }

    /** APP提交注册后保存用户2.0
     *
     * @param userId  用户逻辑ID
     * @param realName  姓名
     * @param password 密码，MD5加密
     * @param phoneNum 手机号
     * @param token
     */
    public  AppUserInfoPO(
            String userId,String realName,String nickName,String password,String phoneNum,String token, String loginDevice){
        this.userId = userId;
        this.nickName = nickName;
        this.realName = realName;
        this.password = password;
        this.phoneNum = phoneNum;
        this.token = token;
    }

    /**
     * <desc>
     *     APP更新昵称、密码、头像、性别
     * </desc>
     * @param userId
     * @param nickName
     * @param password
     * @param icon
     * @param gender
     */
    public AppUserInfoPO(String userId,String nickName,String password,String icon,Integer gender){
        this.userId = userId;
        this.nickName = nickName;
        this.password = password;
        this.icon = icon;
        this.gender = gender;
    }

    public AppUserInfoPO(String userId){
        this.userId = userId;
    }




}
